//
//  QueryCell.m
//  PropertyMananger
//
//  Created by bh on 16/12/23.
//  Copyright © 2016年 BH. All rights reserved.
//

#import "QueryCell.h"
static CGFloat itemtH = 84;
@implementation QueryCell
-(instancetype)initWithFrame:(CGRect)frame
{

    self = [super initWithFrame:frame];
    if (self) {
        
        self.bgView = [[UIView alloc]init];
        [self.contentView addSubview:self.bgView];
        [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.equalTo(self.contentView).with.offset(0);
            make.height.mas_equalTo(itemtH);
        }];
        UIView * rightLine = [[UIView alloc]init];
        [self.bgView addSubview:rightLine];
        rightLine.backgroundColor = BHColor(230, 230, 230);
        [rightLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.trailing.equalTo(self.bgView.mas_trailing).with.offset(0);
            make.top.equalTo(self.bgView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(1, itemtH));
        }];
        
        UIView * bottomLine = [[UIView alloc]init];
        [self.bgView addSubview:bottomLine];
        bottomLine.backgroundColor = BHColor(230, 230, 230);
    
        [bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.equalTo(self.bgView.mas_bottom).with.offset(0);
            make.leading.equalTo(self.bgView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(88, 1));
        }];
        
        self.iconImg = [[UIImageView alloc]init];
        [self.bgView addSubview:self.iconImg];
        [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.bgView).with.offset(0);
            make.centerY.equalTo(self.bgView).with.offset(-20);
            make.size.mas_equalTo(CGSizeMake(25, 25));
        }];
        
        self.titleLabel = [[UILabel alloc]init];
        [self.bgView addSubview:self.titleLabel];
        self.titleLabel.textColor = BHColor(26, 26, 26);
        self.titleLabel.font = BHFont(13);
        self.titleLabel.textAlignment = NSTextAlignmentCenter;
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self.bgView).with.offset(0);
            make.centerY.equalTo(self.bgView).with.offset(10);
             make.size.mas_equalTo(CGSizeMake(BHscreenW/3, 30));
        }];
    }
    return self;
}
@end
